﻿using System;

namespace GetWallPagerFromBing
{
    public static class Utils
    {
        public static string AppPath
        {
            get
            {
                return AppDomain.CurrentDomain.BaseDirectory;
            }
        } 

        /// <summary>
        /// 判断本机是否联网
        /// </summary>
        /// <returns></returns>
        public static bool IsConnectNetwork()
        {
            try
            {
                int dwFlag = 0;
                return Win32Util.InternetGetConnectedState(ref dwFlag, 0);
            }
            catch (Exception ex)
            {
                SimpleLog.GetLog(ex.Message);
            }
            return false;
        }
    }
}
